package com.xe.util;

import java.util.HashMap;
import java.util.Map;

public class XECodemirrorConfig {

	Map<String,String> editor = new HashMap<>();
	
	Map<String,String> editorMime = new HashMap<>();
	
	
	public XECodemirrorConfig() {
		loadEditor();
		loadEditorMime();
	}


	private void loadEditorMime(){
			XMime m = new XMime();
			editorMime.putAll(m.mime);
			editorMime.put("gsps","text/html");
			editorMime.put("gsp","text/html");
			editorMime.put("gtar","text/html");
			editorMime.put("gtmpl","text/html");
			editorMime.put("groovy","text/x-groovy");
			
		
	}
	private void loadEditor() {
				editor.put("asc","/_xe/codemirror/mode/sql/sql.js");
				editor.put("bat","/_xe/codemirror/mode/sql/sql.js");
				editor.put("c","/_xe/codemirror/mode/sql/sql.js");
				editor.put("cc","/_xe/codemirror/mode/sql/sql.js");
				editor.put("chh","/_xe/codemirror/mode/sql/sql.js");
				editor.put("cmd","_xe/codemirror/mode/sql/sql.js");
				editor.put("cpp","_xe/codemirror/mode/sql/sql.js");
				editor.put("css","/_xe/codemirror/mode/css/css.js");
				editor.put("csv","/_xe/codemirror/mode/sql/sql.js");
				editor.put("cxx","/_xe/codemirror/mode/sql/sql.js");
				editor.put("dtd","/_xe/codemirror/mode/sql/sql.js");
				editor.put("etx","/_xe/codemirror/mode/sql/sql.js");
				editor.put("groovy","/_xe/codemirror/mode/groovy/groovy.js");
				editor.put("grxml","/_xe/codemirror/mode/sql/sql.js");
				editor.put("gsp","_xe/codemirror/mode/htmlmixed/htmlmixed.js");
				editor.put("gtmpl","_xe/codemirror/mode/htmlmixed/htmlmixed.js");
				editor.put("h","/_xe/codemirror/mode/sql/sql.js");
				editor.put("htc","/_xe/codemirror/mode/sql/sql.js");
				editor.put("htm","_xe/codemirror/mode/htmlmixed/htmlmixed.js");
				editor.put("html","_xe/codemirror/mode/htmlmixed/htmlmixed.js");
				editor.put("ics","_xe/codemirror/mode/sql/sql.js");
				editor.put("ifb","_xe/codemirror/mode/sql/sql.js");
				editor.put("ini","_xe/codemirror/mode/sql/sql.js");
				editor.put("java","_xe/codemirror/mode/sql/sql.js");
				editor.put("mathml","_xe/codemirror/mode/sql/sql.js");
				editor.put("py","_xe/codemirror/mode/sql/sql.js");
				editor.put("rdf","_xe/codemirror/mode/sql/sql.js");
				editor.put("rtf","_xe/codemirror/mode/sql/sql.js");
				editor.put("rtx","_xe/codemirror/mode/sql/sql.js");
				editor.put("sgm","_xe/codemirror/mode/sql/sql.js");
				editor.put("sgml","_xe/codemirror/mode/sql/sql.js");
				editor.put("sql","_xe/codemirror/mode/sql/sql.js");
				editor.put("svg","_xe/codemirror/mode/sql/sql.js");
				editor.put("tsv","_xe/codemirror/mode/sql/sql.js");
				editor.put("txt","_xe/codemirror/mode/sql/sql.js");
				editor.put("wml","_xe/codemirror/mode/sql/sql.js");
				editor.put("wmls","_xe/codemirror/mode/sql/sql.js");
				editor.put("xht","_xe/codemirror/mode/htmlmixed/htmlmixed.js");
				editor.put("xhtml","_xe/codemirror/mode/htmlmixed/htmlmixed.js");
				editor.put("xml","_xe/codemirror/mode/sql/sql.js");
				editor.put("xsl","_xe/codemirror/mode/sql/sql.js");
				editor.put("xslt","_xe/codemirror/mode/sql/sql.js");
				editor.put("xul","_xe/codemirror/mode/sql/sql.js");
						
	}


	public String getProperty(String ext) {
		return editor.get(ext);
	}
	public String getMimeProperty(String ext) {
		return editorMime.get(ext);
	}
	
	
	
}
